public class HexToDec {
    //this programe is built for tranfer number from Hex to Dec.

    public static void main(String[] args){
        HexToDec hex = new HexToDec();
        hex.transfer(26);
    }

    public void transfer(int n){
        String str = "";
        int res = n / 16;
        int yushu = n % 16;
        str = NumToChar(yushu);

        while(res > 0){
            yushu = res % 16;
            res = res / 16;
            str = NumToChar(yushu) + str;
        }

        System.out.println("The hex type value is :" + str);
    }

    private String NumToChar(int num){
        switch(num){
            case 10:
                return("A");
            case 11:
                return("B");
            case 12:
                return("C");
            case 13:
                return("D");
            case 14:
                return("E");
            case 15:
                return("F");
            default:
                return(""+num);
        }    
    } 
    
}